package org.qrd.openmayyam;

import java.io.File;
import java.io.FileFilter;

	/**
	 * A implementation of the FileFilter interface to filter WAR files 
	 * @author Adarsh
	 * @author Sivaraman
	 */

public class Filter implements FileFilter {
	
	/**
	 * This string variable holds the extension of the file to be filtered.
	 */

	String extension="";
	
	/**
	 * Adds a "." to the extension variable.
	 */
	
	public Filter(String extension)
	{
		this.extension="." + extension;
	}
	
	/**
	 * Returns a boolean value if the file ends with the extension.
	 * @param arg0 The file name of the file to be filtered. 
	 */
	
	public boolean accept(File arg0) {
		
		return arg0.getName().endsWith(extension);
	}
	
	

	
}
